package com.uzai.console.service.order.impl;

import com.uzai.common.enums.OrderSourceEnum;
import com.uzai.console.service.order.OrderSourceService;
import com.uzai.console.vo.order.OrderSourceVo;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单来源
 * @author liuqi
 * @date 2021年08月19日 16:50
 */
@Service
public class OrderSourceServiceImpl implements OrderSourceService {

    /**
     * 查询订单状态列表
     * @author liuqi
     * @date 2021/8/19 16:51
     * @return java.util.List<com.uzai.console.vo.order.OrderSourceVo>
     */
    public List<OrderSourceVo> findOrderSourceList(){
        //新建返回集合
        List<OrderSourceVo> orderSourceVoList = new ArrayList<OrderSourceVo>();
        //获取订单状态枚举
        OrderSourceEnum[] orderSourceEnumArr = OrderSourceEnum.values();
        if(orderSourceEnumArr != null && orderSourceEnumArr.length > 0){
            //遍历订单状态枚举
            for (OrderSourceEnum orderSourceEnum : orderSourceEnumArr){
                if(orderSourceEnum.getId().intValue() != 3){ //过滤掉Ipad协议个人微信
                    OrderSourceVo orderSourceVo = new OrderSourceVo();
                    orderSourceVo.setKey(orderSourceEnum.getId());
                    orderSourceVo.setValue(orderSourceEnum.getDesc());
                    orderSourceVoList.add(orderSourceVo);
                }
            }
        }

        return orderSourceVoList;
    }



}
